package cn.edu.xmu.oomall.share.microservice;

import cn.edu.xmu.oomall.share.microservice.vo.OnSaleRetVo;
import cn.edu.xmu.oomall.share.microservice.vo.ProductRetVo;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Feign GoodsAPI
 *
 * @author jianxiang xie
 * @date 2021/11/12
 */
@FeignClient(name = "goods-service")
public interface GoodsService {

    /**
     * 根据id获取onsale
     *
     * @param onSaleId onSaleID
     * @return OnSaleRetVo
     */
    @GetMapping("internal/onsales/{id}")
    InternalReturnObject<OnSaleRetVo> getOnSaleRetVo(@PathVariable("id") Long onSaleId);

    /**
     * 根据id获取product
     *
     * @param pruductId pruductId
     * @return 货品的详细信息
     */
    @GetMapping("/products/{id}")
    InternalReturnObject<ProductRetVo> getProductDetail(@PathVariable("id") Long pruductId);

}
